{% load i18n %}
<li class="dropdown-submenu filter-date">
  <a><i class="icon-filter {% if spec.is_used %}text-success{%else%}muted{% endif %}"></i> {{ title }}</a>
  <ul class="dropdown-menu">
    {% for choice in choices %}
      <li{% if choice.selected %} class="active"{% endif %}>
      <a href="{{ choice.query_string|iriencode }}">{{ choice.display }}</a></li>
    {% endfor %}
    <li class="dropdown-submenu menu-choice-date{% if choice_selected %} active{% endif %}">
      <a>{% trans "Choice Date" %}</a>
      <div class="popover right dropdown-menu">
        <div class="arrow"></div>
        <div class="popover-inner">
          <h3 class="popover-title">{% trans "Choice Date" %}</h3>
          <div class="popover-content">
            <form method="get" action="" class="form-inline">
              {{ form_params|safe }}
              <input name="{{year_name}}" class="choice-year" type="text" placeholder="{% trans "year" %}" size="4" value="{{year_val}}"> /
              <input name="{{month_name}}" class="choice-month" type="text" placeholder="{% trans "month" %}" size="2" value="{{month_val}}"> /
              <input name="{{day_name}}" class="choice-day" type="text" placeholder="{% trans "day" %}" size="2" value="{{day_val}}">
              <button class="btn btn-success" type="submit">{% trans "Apply" %}</button>
            </form>
          </div>
        </div>
      </div>
    </li>
    <li class="dropdown-submenu menu-date-range"><a>{% trans "Date Range" %}</a>
      <div class="dropdown-menu">
        <form method="get" action="">
          <div class="ranges">
            <fieldset class="range_inputs">
              <legend>{% trans "Select Date" %}</legend>
              <label for="{{since_name}}">{% trans "From" %}</label>
              <input class="span12 start_input" type="text" name="{{since_name}}" value="{{since_val}}" />
              <label for="{{until_name}}">{% trans "To" %}</label>
              <input class="span12 end_input" type="text" name="{{until_name}}" value="{{until_val}}" />
              <button type="submit" class="btn btn-success">{% trans "Apply" %}</button>
            </fieldset>
          </div>
          <div class="calendar date-start pull-left" data-date="{{since_val}}"></div>
          <div class="calendar date-end pull-left" data-date="{{until_val}}"></div>
          {{ form_params|safe }}
        </form>
      </div>
    </li>
  </ul>
</li>